# --**coding:utf-8**--

class Element:

    def __init__(self):
        self.ele_list = []

    def _get_all_node(self,node):
        if isinstance(node,list):
            for item in node:
                # 递归查询子结点
                self._get_all_node(item)
        elif isinstance(node,dict):
            if 'node' in node.keys():
                new_node = node.copy()
                new_node.pop('node')
                self.ele_list.append(new_node)
                self._get_all_node(node.get('node'))
        else:
            self.ele_list.append(node)


    def get_elemant(self,node):
        self._get_all_node(node)
        return self.ele_list